package com.srcptit.java.training.kienbd.bt1;
import java.util.Scanner;
public class Muc1_Bai2_UCLN {
	static int ucln(int a,int b)
	{
            while(a!=0&&b!=0)
            {
		if(a>b)	a=a%b;
		else	b=b%a;
            }
            if(a==0)	return b;
            else		return a;
	}
	static void kt()
	{
            Scanner sc=new Scanner(System.in);
            System.out.print("So a : ");
            int a=sc.nextInt();
            System.out.print("So b : ");
            int b=sc.nextInt();
            System.out.print("Uoc so chung lon nhat cua a va b : "+ucln(a,b));
            sc.close();
	}
	public static void main(String args[])
        {
            kt();
        }
}
